package com.imooc.study.imoocstudy.test.map;

import java.util.HashMap;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;

public class MapEntrySet {
    public static void main(String[] args){
        Map<String,String> map = new HashMap<>();

        map.put("杨过", "男");
        map.put("小龙女", "女");
        map.put("蛮子", "男");
        map.put("艾希","女");

        System.out.println(map);
        // 3.entrySet遍历
        Set<Entry<String, String>> entry =  map.entrySet();
        for(Entry<String, String> en:entry){
            System.out.println(en.getKey()+"--->"+en.getValue());
        }
    }
}
